package dao;

import domain.ErrorLog;
import domain.Log;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ErrorLogDao {

    @Select("select * from errorlog order by id desc")
    List<ErrorLog> findAll();

    @Insert("insert into errorlog values(null,#{username},#{method},#{url},#{clientIp},#{status},#{visitTime},#{exceptionMessage},#{stackTrace})")
    void add(ErrorLog errorlog);

    @Select("select * from errorlog where id=#{id}")
    ErrorLog findById(int id);
}
